.text
	.align 4
.globl _arm11_mutex_lock
_arm11_mutex_lock:
	mov	ip, sp
	stmfd	sp!, {r4-r6, fp, ip, lr, pc}

	ldrex	r4, [r0]
	sub	r4, r4, #1
	strex	r5, r4, [r0]
	
	ldmea	fp, {r4-r6, fp, sp, pc}


.globl _arm11_mutex_unlock
_arm11_mutex_unlock:
	mov	ip, sp
	stmfd	sp!, {r4-r6, fp, ip, lr, pc}

	ldrex	r4, [r0]
	add	r5, r4, #1
	strex	r6, r5, [r0]

	ldmea	fp, {r4-r6, fp, sp, pc}
